package com.wnxy.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @Classname ResultVO
 * @Description :
 * @Date 2021/2/23 17:52
 * @Created by Yeheng
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultVO implements Serializable {
    private Integer status;     // 响应码
    private String message;     // 响应简要信息
    private Object data;        // 响应的主体数据

    public ResultVO(Integer status, String message) {
        this.status = status;
        this.message = message;
    }

    public static ResultVO success(Object data){
        ResultVO resultVO = new ResultVO();
        resultVO.setMessage("成功");
        resultVO.setStatus(ResultConstant.OP_SUCCESS);
        resultVO.setData(data);
        return resultVO;
    }
}
